package com.peanutplan.blog.model.vo;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

/**
 * 文章的es实体封装
 * @author chenyang
 *
 */
public class ContentEsVo implements Serializable {
    /**
	 *  
	 */
	private static final long serialVersionUID = 1L;

	public ContentEsVo() {
		
	}
	public ContentEsVo(ContentVo contentVo) {
		this.cid = contentVo.getCid();
		if(StringUtils.isNoneBlank(contentVo.getCategories())) {
			this.categories = contentVo.getCategories();
		}
		this.content = contentVo.getContent();
		this.created = contentVo.getCreated();
		this.status = contentVo.getStatus();
		if(StringUtils.isNoneBlank(contentVo.getTags())) {
			this.tags = contentVo.getTags();
		}
		this.title = contentVo.getTitle();
		this.type = contentVo.getType();
		this.allowPing = contentVo.getAllowPing();
		
		this.cover = contentVo.getCover();
		
		this.remark = contentVo.getRemark();
		
		this.contentText = contentVo.getContentText();
	}
	
	/**
     * post表主键
     */
    private Integer cid;

    /**
     * 内容标题
     */
    private String title;

    /**
     * 内容生成时的GMT unix时间戳
     */
    private Integer created;

    /**
     * 内容类别
     */
    private String type;

    /**
     * 内容状态
     */
    private String status;

    /**
     * 标签列表
     */
    private String tags;

    /**
     * 分类列表
     */
    private String categories;

    /**
     * 内容文字
     */
    private String content;
    
    /**
     * 纯文本内容
     */
    private String contentText;
    
    private String remark;
    
    private Boolean allowPing;
    
    private String cover;
    
    private float score;
    
	public Integer getCid() {
		return cid;
	}

	public void setCid(Integer cid) {
		this.cid = cid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getCreated() {
		return created;
	}

	public void setCreated(Integer created) {
		this.created = created;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public String getCategories() {
		return categories;
	}

	public void setCategories(String categories) {
		this.categories = categories;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	public Boolean getAllowPing() {
		return allowPing;
	}
	public void setAllowPing(Boolean allowPing) {
		this.allowPing = allowPing;
	}
	public String getCover() {
		return cover;
	}
	public void setCover(String cover) {
		this.cover = cover;
	}
	public float getScore() {
		return score;
	}
	public void setScore(float score) {
		this.score = score;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getContentText() {
		return contentText;
	}
	public void setContentText(String contentText) {
		this.contentText = contentText;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cid == null) ? 0 : cid.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContentEsVo other = (ContentEsVo) obj;
		if (cid == null) {
			if (other.cid != null)
				return false;
		} else if (!cid.equals(other.cid))
			return false;
		return true;
	}
}